home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -websites- / wirenet / files / wirenet151.lzx / ReadConfig.rexx next >
OS/2 REXX Batch file  |  1987-06-21  |  1KB  |  43 lines

  1. /* ReadConfig by Neil Bothwick */
  2. /* Reads ppp0.config and DialScript to determine various configuration values */
  3.  
  4. options results
  5.  
  6. if open(ppp,'ENV:sana2/ppp0.config','R') then do
  7.     do until left(cfgline,1) ~= '#'
  8.         cfgline = readln(ppp)
  9.         end
  10.     /* serial.device 0 57600 194.119.174.218 MTU=1500 CD 7WIRE EOFMODE DialScript=AmiTCP:db/DialScript */
  11.     parse var cfgline Device Unit Speed .
  12.  
  13.     call close(ppp)
  14.     end
  15.  
  16. if open(ds,'AmiTCP:db/DialScript','R') then do
  17.     do until eof(ds)
  18.         NextLine = readln(ds)
  19.         select
  20.             when upper(left(NextLine,10)) = 'SEND "ATDT' then PopNum = substr(NextLine,11)
  21.             when pos('assword:',NextLine) > 0 then do
  22.                 do until upper(left(NextLine,4)) = 'SEND'
  23.                     NextLine = readln(ds)
  24.                     end
  25.                 parse var NextLine a '"' PassWord '"' .
  26.                 end
  27.             otherwise nop
  28.             end
  29.         end
  30.     end
  31.  
  32. address command
  33. if symbol('Device') = 'VAR' then 'setenv WirenetUpdateDevice' compress(Device,'"')
  34. if symbol('Unit') = 'VAR' then 'setenv WirenetUpdateUnit' compress(Unit,'"')
  35. if symbol('Speed') = 'VAR' then 'setenv WirenetUpdateSpeed' compress(Speed,'"')
  36. if symbol('PopNum') = 'VAR' then 'setenv WirenetUpdatePopNum' compress(PopNum,'"')
  37. if symbol('Password') = 'VAR' then 'setenv WirenetUpdatePassword' compress(Password,'"')
  38.  
  39.  
  40.  
  41.  
  42.  
  43.